package com.lfy.modules.common.custom.constants;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * AI常量枚举集合
 */
public interface AIEnum {
    /**
     * 通义千问API
     */
    String QW_KEY = "QWEN";
    String KIMI_KEY = "KIMI";
    /**
     * 正在聊天
     */
    String CHAT_STATUS = "1";
    /**
     * 结束聊天
     */
    String END_CHAT_STATUS = "2";
    /**
     * 异常聊天
     */
    String EXCEPTION_CHAT_STATUS = "3";
    /**
     *
     * AI模型
     */
    @AllArgsConstructor
    @Getter
    enum AiModel{
        QwenAi(1, "通义千问"),
        KimiAi(2, "KIMI"),
        BaiduAi(3, "百度AI"),
        ;
        final Integer code;
        final String aiType;
    }
    @AllArgsConstructor
    @Getter
    enum KIMIType {
        plus(1, "moonshot-v1-8k"),
        pro(2, "moonshot-v1-32k"),
        ;
        final Integer code;
        final String kimiType;

        public static String getKIMIType(Integer code) {
            if (code == null) {
                return KIMIType.plus.getKimiType();
            }
            for (KIMIType kimiType : KIMIType.values()) {
                if (kimiType.code.equals(code)) {
                    return kimiType.getKimiType();
                }
            }
            // 默认turbo
            return KIMIType.plus.getKimiType();
        }
    }
        /**
         * 通义千问模型
         */
        @AllArgsConstructor
        @Getter
        enum QWENType {
            turbo(1, "qwen-turbo"),
            //        plus(2, "qwen-plus"),
            max(3, "qwen-max"),
            ;
            final Integer code;
            final String qwenType;

            public static String getQWENType(Integer code) {
                if (code == null) {
                    return QWENType.turbo.getQwenType();
                }
                for (QWENType qwenType : QWENType.values()) {
                    if (qwenType.code.equals(code)) {
                        return qwenType.getQwenType();
                    }
                }
                // 默认turbo
                return QWENType.turbo.getQwenType();
            }
        }

}
